package com.huangpuweb.task.service.imp;

import com.huangpuweb.task.model.SysHpEmergencyEvent;
import com.huangpuweb.task.model.ZyHpEmergencyEventRowMapper;
import com.huangpuweb.task.service.ApiService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ApiServiceImp extends BaseServiceImp implements ApiService {


    public int getListEmergencyEventAllCount(String starttime) {

        String sql="select count(Guid) from lj_er_work_log_detail where beginTime>=? ";
        return queryInteger(sql, new Object[] {starttime});
    }

    public List<SysHpEmergencyEvent> getListSysHpEmergencyEvent(int page, int pagecount,String starttime) {

        String sql="select * from lj_er_work_log_detail  where beginTime>=? order by beginTime asc limit ? offset ?";
        return getEntryList(sql, new ZyHpEmergencyEventRowMapper(), new Object[] {starttime,pagecount,(page - 1) * pagecount});
    }
}
